-- Viral Resistance - T-Engine 4 Module
-- Copyright (C) 2010 Mikolai Fajer
--
-- This program is free software: you can redistribute it and/or modify
-- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation, either version 3 of the License, or
-- (at your option) any later version.
--
-- This program is distributed in the hope that it will be useful,
-- but WITHOUT ANY WARRANTY; without even the implied warranty of
-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-- GNU General Public License for more details.
--
-- You should have received a copy of the GNU General Public License
-- along with this program.  If not, see <http://www.gnu.org/licenses/>.
--
-- Mikolai Fajer "yufra"
-- mfajer@gmail.com

local Object = require "mod.class.Object"

defineTile('>', 'DOWN')
defineTile('<', 'UP')
defineTile('#', 'WALL')
defineTile('*', 'WALL', nil, 'EMERGENCY_LIGHT', nil, nil, {type="light", subtype="emergency"})
defineTile('.', 'FLOOR')
defineTile('o', 'WINDOWED_DOOR')
defineTile('+', 'WOODEN_DOOR')
defineTile('=', 'DESK')
defineTile('B', 'BED')
defineTile('W', 'WINDOW')

-- Add the stairs
addSpot({31, 1}, 'stairs', 'a')
addSpot({33, 1}, 'stairs', 'b')
addSpot({64, 1}, 'stairs', 'c')
addSpot({66, 1}, 'stairs', 'd')
addSpot({31, 37}, 'stairs', 'e')
addSpot({33, 37}, 'stairs', 'f')
addSpot({64, 37}, 'stairs', 'g')
addSpot({66, 37}, 'stairs', 'h')

-- Add the elevator doors and buttons
defineTile('E', 'ELEVATOR_DOOR')
local button = Object.new{
	name="Elevator Button",
	desc=[[A panel of buttons.]],
	display='x', color=colors.SLATE,
	can_talk = "elevator",
	show_tooltip=true,
	type = "button", subtype="button",
}
defineTile('e', 'WALL', button)

-- Add signs
local newSign = function(tooltip)
		return Object.new{show_tooltip=true, tooltip=tooltip, name='sign', display='?', color=colors.GREY}
	end
defineTile('C', 'WALL', newSign("Chief of Medicine's Office"))
defineTile('S', 'WALL', newSign("Security Station"))

-- Add the emergyency phone
local phone = game.zone.grid_list.DESK:clone()
table.merge(phone, {
	show_tooltip=true,
	name="Emergency Phone",
	desc=[[A red phone.]],
	display='x', color_r=100, color_g=0, color_b=0,
	can_talk = "emergency_phone",
})
quickEntity('p', phone)

startx = 4
starty = 4
endx = 4
endy = 4

return [[
##################################################################################################
#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#>#<##############################>#<#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#
#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#.#.##############################.#.#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#
#....#....#....#....#....#....#...##############################...#....#....#....#....#....#....#
#....#....#....#....#....#....#...##############################...#....#....#....#....#....#....#
###o###o#####o###o#####o###o####o################################o####o###o#####o###o#####o###o###
#.............................#....................................#.............................#
#.............................#....................................#.............................#
#....===.======.======.===....#....................................#....===.======.======.===....#
#....=...................=....o...##############################...o....=...................=....#
#....=...................=....o...##############################...o....=...................=....#
#....===.======.======.===....#...##############################...#....===.======.======.===....#
#.............................#...##############################...#.............................#
#.............................#...##############################...#.............................#
###o###o#####o###o#####o###o###...##############################...###o###o#####o###o#####o###o###
#....#....#....#....#....#....#...###########...#...############...#....#....#....#....#....#....#
#....#....#....#....#....#....#...###########...e...############...#....#....#....#....#....#....#
#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#...############E#*#E#############...#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#
#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#....................................#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#
###############################....................................###############################
#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#....................................#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#
#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#...############E#*#E#########S+##...#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#
#....#....#....#....#....#....#...###########...e...#######....#...#....#....#....#....#....#....#
#....#....#....#....#....#....#...###########...#...#######....#...#....#....#....#....#....#....#
###o###o#####o###o#####o###o###...#########################....=...###o###o#####o###o#####o###o###
#.............................#...#########################....=...#.............................#
#.............................#...#########################....=...#.............................#
#....===.======.======.===....#...#########################....#...#....===.======.======.===....#
#....=...................=....o...#########################....#...o....=...................=....#
#....=...................=....o...##########################S+##...o....=...................=....#
#....===.======.======.===....#....................................#....===.======.======.===....#
#.............................#....................................#.............................#
#.............................#....................................#.............................#
###o###o#####o###o#####o###o####o####+###C+#################+####o####o###o#####o###o#####o###o###
#....#....#....#....#....#....#...#.....#...#.......=...p#.....#...#....#....#....#....#....#....#
#....#....#....#....#....#....#...#.....#...+.......=....#.....#...#....#....#....#....#....#....#
#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#.#.#.....#==.#.......==...#.....#.#.#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#
#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#>#<#.....#...#............#.....#>#<#.BB.#.BB.#.BB.#.BB.#.BB.#.BB.#
##############################################WW#WWWW#WW##########################################]]
